<h2>
  <%=h @user.name %>
  <%= link_to content_tag('small', 'edit'), edit_user_path(@user) if current_user.can_update_user? @user %>
</h2>
<div class="kind"><%=h @user.kind %></div>
<%= content_tag :h3, @user.online? ? 'Online' : 'Offline' %>
<p>Registered <%= smart_time_ago_in_words(@user.created_at) %></p>

<% if @user == current_user %>
  <p><%= link_to 'Subscriptions', :controller => 'subscribed' %></p>
<% end %>

<% unless @user.admin? %>
  <h3>Moderated Forums</h3>
  <ul>
  <% for moderatorship in @user.moderatorships %>
    <li>
      <%= link_to moderatorship.forum.name, forum_path(moderatorship.forum) %>
      <% if current_user.can_destroy_moderatorship? moderatorship %>
        <%= link_to 'remove', moderatorship_path(moderatorship), :confirm => 'Are you sure?', :method => 'delete' %>
      <% end %>
    </li>
  <% end %>
  </ul>
  <%= link_to 'add forum', new_moderatorship_path(:user_id => @user) if current_user.can_create_moderatorship? %>
<% end %>

<h3>Contributed to Topics</h3>
<%= render :partial => 'shared/topics' %>
